//
//  CircleDetailViewController.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/3.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CircleDetailViewController.h"
#import "CircleDetailViewModel.h"
#import "CircleDetailReplyListrViewModel.h"
#import "CircleAllReplayViewController.h"

@interface CircleDetailViewController ()
@property (nonatomic, strong) CircleDetailViewModel *viewModel;
@property (nonatomic, strong) CircleDetailReplyListrViewModel *listViewModel;

@end

@implementation CircleDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"详情";
    self.viewModel = [[CircleDetailViewModel alloc] initWithViewToViewModel:self.groupedTableView theSuperView:self.view];
    kWeakSelf(self);
    self.viewModel.BlockReply = ^(GLGWButton * _Nullable replyBtn) {
        [weakself.listViewModel showReplyListView];
    };
    self.viewModel.BlockAllReply = ^(GLGWButton * _Nullable allReplyBtn) {
        weakself.listViewModel = [[CircleDetailReplyListrViewModel alloc] initWithViewToViewModel:weakself.tableView theSuperView:weakself.view];

    };
    self.viewModel.BlockLike = ^(GLGWButton * _Nullable likeBtn) {
    };
}

- (void)viewWillDisappear:(BOOL)animated
{
    [_listViewModel deleteView];

}

- (CircleDetailReplyListrViewModel *)listViewModel
{
    if (!_listViewModel) {
        _listViewModel = [[CircleDetailReplyListrViewModel alloc] initWithViewToViewModel:self.tableView theSuperView:self.view];
    }
    return _listViewModel;
}

- (void)dealloc
{
//    [_listViewModel deleteView];
}

@end
